IdCreator = IdCreator or Class("IdCreator")

---@diagnostic disable-next-line: duplicate-set-field
function IdCreator:ctor(start)
    self.count = start and start - 1 or 0
end

function IdCreator:create()
    self.count = self.count + 1
    return self.count
end

function IdCreator:load(id)
    self.count = math.max(self.count, id)
end

function IdCreator:getCount()
    return self.count
end